#define _CRT_SECURE_NO_WARNINGS
class Solution {
public:
    int removeDuplicates(vector<int>& nums) {
        int first = 0;
        int secord = 1;
        for (int i = 0; i < nums.size() - 1; i++)
        {
            int tmp = nums[i];
            int tmp1 = nums[i + 1];
            int ret = tmp ^ tmp1;
            if (ret != 0)
            {
                nums[first] = nums[i];
                nums[secord] = nums[i + 1];
                first++;
                secord++;
            }


        }
        return secord;
    }
};